package com.flyme.module.base.provider.controller;

import com.flyme.common.core.model.ResultBody;
import com.flyme.common.core.model.query.CriteriaQuery;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.common.core.model.query.PqGrid;
import com.flyme.core.base.supper.controller.BaseController;
import com.flyme.core.base.supper.entity.EntityMap;
import com.flyme.module.base.client.api.SysUserTrainRemoteService;
import com.flyme.module.base.client.entity.SysUserTrain;
import com.flyme.module.base.provider.service.SysUserTrainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 三期用户培训经历管理
 * @author zyh
 * @date 2020-7-7
 */
@Api(tags = "三期用户培训经历")
@RestController
public class SysUserTrainController extends BaseController<SysUserTrainService, SysUserTrain> implements SysUserTrainRemoteService {


    /**
     * 学员列表
     *
     * @return
     */
    @ApiOperation(value = "学员培训经历列表", notes = "学员培训经历列表")
    @Override
    public ResultBody list(@ModelAttribute PagerInfo pagerInfo, @RequestParam Long userId) {
        CriteriaQuery cq = new CriteriaQuery<EntityMap>(pagerInfo);
        cq.select("ut.*");
        cq.eq("userId", userId);
        PqGrid pqGrid = bizService.pageList(cq);
        return ResultBody.success(pqGrid);
    }

}
